<!--鉴定结论更正 -->
<template>
    <el-main>
        <el-main class="ep-body">
            <epl-top-bar :datas="{formData:form,panel:panel}" showPerson personType="PERSON_ALL_EXACT" psTagType="PERSON_INJURY_QUERY">
                <ep-button size="small" name="刷新"></ep-button>
            </epl-top-bar>
            <epl-userMessage dataType="person" idCount="4" >
            </epl-userMessage>

            <el-card class="ep-card">

                <el-form :model="form"  :rules="rules" >

                    <el-row :gutter="10">
                        <ep-input  label="人员id" name="aac001" :property="form.aac001"
                                   p="H"   :datas="{formData: form}" ></ep-input>
                        <ep-input  label="申报编号" name="bae506" :property="form.bae506"
                                   p="H"   :datas="{formData: form}" ></ep-input>

                    </el-row>
                    <el-card  v-show="show01">
                    <ep-title>原申报信息</ep-title>
                    <el-row :gutter="10">
                        <ep-input  label="人员编号" name="lc61aac001" :property="form.lc61aac001"
                                   p="H"  :datas="{formData: form}"></ep-input>
                        <ep-input colspan="8" label="姓名" name="lc61aac003"  :property="form.lc61aac003"
                                  p="R"  :datas="{formData: form}"></ep-input>
                        <ep-input colspan="4" label="年龄" name="lc61nl" :property="form.lc61nl"
                                  p="E"  :datas="{formData: form}"></ep-input>
                        <ep-select colspan="4" label="性别" name="lc61aac004" :property="form.lc61aac004" placeholder="请输入性别"
                                   p="E" :datas="{formData: form}" codetype="AAC004" ></ep-select>
                        <ep-select colspan="8" label="民族" name="lc61aac005" :property=" form.lc61aac005" placeholder="请输入民族"
                                   p="E" :datas="{formData: form}" codetype="AAC005"  ></ep-select>
                    </el-row>
                    <el-row :gutter="10">

                        <ep-input colspan="8" label="身份证号码" name="lc61aac147" :property="form.lc61aac147" placeholder="请输入身份证号码" isChange
                                  p="R"  :datas="{formData: form}" isChange ></ep-input>
                        <ep-input colspan="8" label="手机号码" name="lc61aac067" :property="form.lc61aac067" placeholder="请输入手机号码"
                                  p="E" :datas="{formData: form}"></ep-input>
                        <ep-input colspan="8" label="联系电话" name="lc61aae005" :property="form.lc61aae005" placeholder="请输入联系电话"
                                  p="E" :datas="{formData: form}"></ep-input>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-input colspan="16" label="单位id" name="lc62aab001" :property="form.lc62aab001"
                                  p="H" :datas="{formData: form}"></ep-input>
                        <ep-input colspan="16" label="单位名称" name="lc62aab004" :property="form.lc62aab004" placeholder="请输入单位名称"
                                  p="R" :datas="{formData: form}"></ep-input>
                    </el-row>
                    <el-row :gutter="10">
                        <ep-input colspan="8" label="统一社会信用代码" name="lc62bab010" :property="form.lc62bab010" placeholder="请输入统一社会信用代码"
                                  p="E"  :datas="{formData: form}" isChange ></ep-input>
                        <ep-input colspan="8" label="联系人" name="lc62aae004" :property="form.lc62aae004"  placeholder="请输入联系人"
                                  p="E" :datas="{formData: form}"></ep-input>

                        <ep-input colspan="8" label="法人代表" name="lc62aab013" :property="form.lc62aab013" placeholder="请输入法人代表"
                                  p="E" :datas="{formData :form}"></ep-input>
                    </el-row>
                    </el-card>
                    <ep-title>原鉴定结论信息</ep-title>
                    <el-row :gutter="10">
                        <ep-input colspan="16" label="伤情描述" name="elc050" :property="form.elc050"
                                  p="E" :datas="{form: form}"></ep-input>
                    </el-row>
                    <el-card  v-show="show1">
                        <ep-title >初次（复查）、再次鉴定、非因工、委托</ep-title>
                        <el-row :gutter="10">
                            <ep-select colspan="24" label="伤残等级" name="ala040" :property="form.ala040" codetype="ALA040"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                        <el-row :gutter="10">
                            <ep-checkbox colspan="24" label="护理依赖等级" name="alc060" :property="form.alc060" codetype="ALC060"
                                         p="R"   :datas="{form: form}"></ep-checkbox>
                        </el-row>
                    </el-card>
                    <el-card  v-show="show2">
                        <ep-title >供养亲属鉴定</ep-title>
                        <ep-select colspan="10" label="丧失劳动能力鉴定结论" name="alc068" :property="form.alc068" codetype="ALC068"
                                   p="R"   :datas="{form: form}"></ep-select>
                    </el-card>
                    <el-card  v-show="show3">
                        <ep-title >停工留薪期延长确认</ep-title>
                        <el-row :gutter="10">
                            <ep-date colspan="6" label="停工留薪期延长日期" name="aae030" :property="form.aae030" format="yyyyMMdd" value-format="yyyyMMdd"
                                     p="R"   :datas="{form: form}"></ep-date >
                            <ep-date colspan="6" label="至" name="aae031" :property="form.aae031" format="yyyyMMdd" value-format="yyyyMMdd" label-width="40"
                                     p="E"   :datas="{form: form}"></ep-date >
                        </el-row>
                    </el-card>
                    <el-card  v-show="show4">
                        <ep-title >工伤康复确认</ep-title>
                        <el-row :gutter="10">
                            <ep-select colspan="10" label="康复性治疗确认结论" name="alc059" :property="form.alc059" codetype="ALC059"
                                       p="R"   :datas="{form: form}"></ep-select>
                            <ep-select colspan="10" label="康复性治疗部位" name="alc022" :property="form.alc022" codetype="ALC022"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                    </el-card>
                    <el-card  v-show="show5">
                        <ep-title >辅助器具配置确认</ep-title>
                        <el-row :gutter="10">
                            <ep-select colspan="10" label="辅助器具确认结论" name="alc055" :property="form.alc055" codetype="ALC055"
                                       p="R"   :datas="{form: form}"></ep-select>

                        </el-row>
                        <el-row :gutter="10">
                            <ep-select colspan="8" label="辅助器具1" name="alc056" :property="form.alc056" codetype="ALC056"
                                       p="R"   :datas="{form: form}"></ep-select>
                            <ep-select colspan="8" label="辅助器具2" name="alc057" :property="form.alc057" codetype="ALC056"
                                       p="R"   :datas="{form: form}"></ep-select>
                            <ep-select colspan="8" label="辅助器具3" name="alc058" :property="form.alc058" codetype="ALC056"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                    </el-card>
                    <el-card  v-show="show6">
                        <ep-title >老工伤护理依赖程度鉴定</ep-title>
                        <el-row :gutter="10">
                            <ep-select colspan="10" label="丧失劳动能力等级" name="alc060S" :property="form.alc060S" codetype="ALC060"
                                       p="R"   :datas="{form: form}"></ep-select>
                        </el-row>
                    </el-card>
                    <el-card  v-show="show7">
                        <ep-title >工伤复发确认</ep-title>
                        <ep-radio colspan="24" label="是否旧伤复发" name="alc063" :property="form.alc063" codetype="ALC063"
                                  p="R"   :datas="{form: form}"></ep-radio >
                    </el-card>
                    <el-row :gutter="10">
                        <ep-input colspan="24" label="康复性治疗部位" name="alc022" :property="form.alc022"
                                  p="R"  :datas="{formData: form}" ></ep-input>
                    </el-row>
                    <ep-title>更正信息信息</ep-title>
                    <el-row :gutter="10">
                        <ep-select colspan="8" label="更正原因" name="blc566" :property="form.blc566" codetype="BLC566"
                                   p="R" :datas="{form: form}"></ep-select>
                        <ep-select colspan="16" label="更正类型" name="blc567" :property="form.blc567" codetype="BLC567"
                                  p="R" :datas="{form: form}"></ep-select>
                    </el-row>
                    <el-row type="flex" justify="center" >
                        <ep-saveButton id="" top="20" type="primary" bottom="20"
                                       :datas="{formData: form}" name="保存"></ep-saveButton>
                        <ep-Button id="" top="20" type="primary" bottom="20"
                                   name="清空"></ep-Button>
                    </el-row>
                </el-form>
            </el-card>
        </el-main>

    </el-main>

</template>
<script type="es6">
    export default {
        data() {
            return {
                form:{
                    aac001: {
                        value: '',
                        p: 'H'
                    },
                    bae506: {
                        value: '',
                        p: 'H'
                    },
                    lc61aac001: {
                        value: '',
                        p: 'H'
                    },
                    lc61aac003: {
                        value: '',
                        p: 'R'
                    },
                    lc61nl: {
                        value: '',
                        p: 'E'
                    },
                    lc61aac004: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    lc61aac005: {
                        key: '',
                        value: '',
                        p: 'E'
                    },
                    lc61aac147: {
                        value: '',
                        p: 'R'
                    },
                    lc61aac067: {
                        value: '',
                        p: 'E'
                    },
                    lc61aae005: {
                        value: '',
                        p: 'E'
                    },
                    lc62aab001: {
                        value: '',
                        p: 'H'
                    },
                    lc62aab004: {
                        value: '',
                        p: 'R'
                    },
                    lc62bab010: {
                        value: '',
                        p: 'E'
                    },
                    lc62aae004: {
                        value: '',
                        p: 'E'
                    },
                    lc62aab013: {
                        value: '',
                        p: 'E'
                    },
                    elc050: {
                        value: '',
                        p: 'E'
                    },
                    ala040: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc060: {
                        key: [],
                        value: []
                    },
                    alc068: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    aae030: {
                        value: '',
                        p: 'R'
                    },
                    aae031: {
                        value: '',
                        p: 'E'
                    },
                    alc059: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc022: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc055: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc056: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc057: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc058: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc060S: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    alc063: {
                        value: '',
                        p: 'R'
                    },
                    alc022: {
                        value: '',
                        p: 'R'
                    },
                    blc566: {
                        key: '',
                        value: '',
                        p: 'R'
                    },
                    blc567: {
                        key: '',
                        value: '',
                        p: 'R'
                    },

                },

                rules:{
                    lc61aac003: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    lc61aac147: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    lc62aab004: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    ala040: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc060: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc068: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    aae030: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc059: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc022: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc055: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc056: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc057: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc058: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc060S: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc063: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    alc022: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc566: [
                        {required: true, message: '必填项，不能为空'}

                    ],
                    blc567: [
                        {required: true, message: '必填项，不能为空'}

                    ],

                },
                codeTypes:{
                    AAC004:[],
                    AAC005:[],
                    ALA040:[],
                    ALC060:[],
                    ALC068:[],
                    ALC059:[],
                    ALC022:[],
                    ALC055:[],
                    ALC056:[],
                    ALC063:[],
                    BLC566:[],
                    BLC567:[],

                },
                pager: {
                    page: 1,
                    size: 10
                },
                total: 0,
            }
        },
        computed: {
            functionId() {
                if (this.$store.getters.init.path !== this.$route.path) return;
                if (this.$store.getters.init.mdParam === null || this.$store.getters.init.mdParam === undefined) return;
                if (this.$store.getters.init.mdParam.functionid === undefined) return;
                return this.$store.getters.init.mdParam.functionid;
            },
            backFun() {
                return this.$store.getters.backFun;
            },
            init_formData() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitformData: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.formData;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_form() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitform: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.form;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            show01() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show01;
            },
            show1() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show1;
            },
            show2() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show2;
            },
            show3() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show3;
            },
            show4() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show4;
            },
            show5() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show5;
            },
            show6() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show6;
            },
            show7() {
                if (this.$store.getters.common === null) return [];
                return this.$store.getters.common.show7;
            },

        },
        created() {
            let param = {
                path: this.$route.path,
                codeTypes:this.codeTypes,
                form:this.form

            };
            this.$store.dispatch('SET_INIT', param);
        },
        watch: {
            init_formData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            doInitformData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            init_form: {
                handler(value) {
                    if (value == undefined) return;
                    this.getform(value);
                },
                deep: true
            },
            doInitform: {
                handler(value) {
                    if (value == undefined) return;
                    this.getform(value);
                },
                deep: true
            },
            show01: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show1: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show2: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show3: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show4: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show5: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show6: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },
            show7: {
                handler(value) {
                    if (value == undefined) return false;
                    return value;
                },
                deep: true
            },

            backFun: {
                handler(value) {
                    if (value === null) return;
                    this.customBackFun();
                    let backFun = [];
                    backFun = value.split(',');
                    if (backFun.indexOf('rDoInit') >= 0) {
                        let codeTypes = {
                            AAC004:[],
                            AAC005:[],
                            ALA040:[],
                            ALC060:[],
                            ALC068:[],
                            ALC059:[],
                            ALC022:[],
                            ALC055:[],
                            ALC056:[],
                            ALC063:[],
                            BLC566:[],
                            BLC567:[],

                        };
                        let form = {
                            aac001: {
                                value: '',
                                p: 'H'
                            },
                            bae506: {
                                value: '',
                                p: 'H'
                            },
                            lc61aac001: {
                                value: '',
                                p: 'H'
                            },
                            lc61aac003: {
                                value: '',
                                p: 'R'
                            },
                            lc61nl: {
                                value: '',
                                p: 'E'
                            },
                            lc61aac004: {
                                key: '',
                                value: '',
                                p: 'E'
                            },
                            lc61aac005: {
                                key: '',
                                value: '',
                                p: 'E'
                            },
                            lc61aac147: {
                                value: '',
                                p: 'R'
                            },
                            lc61aac067: {
                                value: '',
                                p: 'E'
                            },
                            lc61aae005: {
                                value: '',
                                p: 'E'
                            },
                            lc62aab001: {
                                value: '',
                                p: 'H'
                            },
                            lc62aab004: {
                                value: '',
                                p: 'R'
                            },
                            lc62bab010: {
                                value: '',
                                p: 'E'
                            },
                            lc62aae004: {
                                value: '',
                                p: 'E'
                            },
                            lc62aab013: {
                                value: '',
                                p: 'E'
                            },
                            elc050: {
                                value: '',
                                p: 'E'
                            },
                            ala040: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc060: {
                                key: [],
                                value: []
                            },
                            alc068: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            aae030: {
                                value: '',
                                p: 'R'
                            },
                            aae031: {
                                value: '',
                                p: 'E'
                            },
                            alc059: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc022: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc055: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc056: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc057: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc058: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc060S: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            alc063: {
                                value: '',
                                p: 'R'
                            },
                            alc022: {
                                value: '',
                                p: 'R'
                            },
                            blc566: {
                                key: '',
                                value: '',
                                p: 'R'
                            },
                            blc567: {
                                key: '',
                                value: '',
                                p: 'R'
                            },

                        };

                        let param = {
                            path: this.$route.path,
                            codeTypes:codeTypes,
                            form:form

                        };
                        this.$store.dispatch('SET_INIT', param);
                    }
                }
            }
        },
        methods: {
            getformData(value) {
                this.form = value;
            },
            getform(value) {
                this.form = value;
            },

            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            },
            handleEdit(id) {
                this.dialogFormVisible = true;
            },
            customBackFun(){//自定义方法体
            },
        },
    }
</script>
